/*
   dir.h

   Borland header for some common compatibility functions under linux
*/

/*
 *      C/C++ Run Time Library - Version 1.0
 *
 *      Copyright (c) 2002 by Borland Software Corporation
 *      All Rights Reserved.
 *
 */


#ifndef __DIR_H
#define __DIR_H

#ifndef ___DEFS_H
#include <_defs.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME  0x04
#define DIRECTORY 0x08
#define DRIVE     0x10


#ifndef MAXPATH
#define MAXPATH   1023
#define MAXDIR     255
#define MAXFILE    255
#define MAXEXT     255
#define MAXDRIVE     3
#endif

#ifndef MAX_PATH
#define MAX_PATH (MAXPATH)
#endif

#ifndef _FFBLK_DEF
#define _FFBLK_DEF
struct  ffblk							/* for findfirst/findnext */
{
    void *          ff_reserved;
    long            ff_fsize;
    unsigned long   ff_attrib;
    unsigned short  ff_ftime;
    unsigned short  ff_fdate;
    char            ff_name[MAXPATH];
};
#endif

#ifndef FA_NORMAL
#define FA_NORMAL   0x00        /* Normal file, no attributes */
#define FA_RDONLY   0x01        /* Read only attribute */
#define FA_HIDDEN   0x02        /* Hidden file */
#define FA_SYSTEM   0x04        /* System file */
#define FA_LABEL    0x08        /* Volume label */
#define FA_DIREC    0x10        /* Directory */
#define FA_ARCH     0x20        /* Archive */
#endif /* FA_NORMAL */

#ifndef _A_NORMAL
/* MSC names for file attributes */
#define _A_NORMAL   0x00        /* Normal file, no attributes */
#define _A_RDONLY   0x01        /* Read only attribute */
#define _A_HIDDEN   0x02        /* Hidden file */
#define _A_SYSTEM   0x04        /* System file */
#define _A_VOLID    0x08        /* Volume label */
#define _A_SUBDIR   0x10        /* Directory */
#define _A_ARCH     0x20        /* Archive */
#endif /* _A_NORMAL */

/* Prototypes */

int		findfirst( const char *__path, struct ffblk *__ffblk, int __attrib );
int		findnext( struct ffblk *__ffblk );
int		findclose( struct ffblk *__ffblk );

void    fnmerge( char *__path, const char *__drive,
                 const char *__dir, const char *__name,
                 const char *__ext );

int     fnsplit(const char *__path, char *__drive,
                char *__dir, char *__name, char *__ext );

#ifdef __cplusplus
} /* "C" */
#endif


#endif /* __DIR_H */
